home *** CD-ROM | disk | FTP | other *** search
- package asp.netobjects.nfx.wizard;
-
- import asp.netobjects.nfx.util.ExceptionHandler;
- import asp.netobjects.nfx.util.ExternalError;
- import asp.netobjects.nfx.util.InternalError;
- import com.sun.java.swing.ImageIcon;
- import java.util.Observable;
- import java.util.Observer;
-
- public class WizardPage extends Observable implements Observer {
- public static final int FORWARD = 1;
- public static final int BACKWARD = 2;
- protected Wizard dmWizard;
- protected WizardPageView dmWizardPageView;
- protected ImageIcon dmIcon;
- protected String dmId = "";
- protected boolean dmIsLastPage = false;
- protected boolean dmCanFinish = false;
- protected boolean dmIsDirty = true;
- protected WizardPage dmNext;
- protected WizardPage dmPrevious;
- protected WizardPage dmFinal;
- protected ExceptionHandler dmExceptionHandler;
- protected String dmBulletText = "Bullet text statement. ";
- protected String dmInfoText = "";
-
- public WizardPage(Wizard wizard, String bullet, String info, ImageIcon icon, ExceptionHandler handler) {
- this.dmWizard = wizard;
- this.dmBulletText = bullet;
- this.dmInfoText = info;
- this.dmIcon = icon;
- this.dmExceptionHandler = handler;
- }
-
- public final Wizard getWizard() {
- return this.dmWizard;
- }
-
- public final void setWizard(Wizard wiz) {
- this.dmWizard = wiz;
- }
-
- public final WizardPageView getView() {
- return this.dmWizardPageView;
- }
-
- public final ImageIcon getIcon() {
- return this.dmIcon;
- }
-
- public final ExceptionHandler getExceptionHandler() {
- return this.dmExceptionHandler;
- }
-
- public void setNext(WizardPage page) {
- this.dmNext = page;
- }
-
- public void setPrevious(WizardPage page) {
- this.dmPrevious = page;
- }
-
- public void setFinal(WizardPage page) {
- this.dmFinal = page;
- }
-
- public void setId(int id) {
- this.dmId = String.valueOf(id);
- }
-
- public int getId() {
- return Integer.valueOf(this.dmId);
- }
-
- public boolean isLastPage() {
- return this.dmIsLastPage;
- }
-
- public boolean isDirty() {
- return this.dmIsDirty;
- }
-
- public void setDirty(boolean set) {
- this.dmIsDirty = set;
- }
-
- public boolean canFinish() {
- return this.dmCanFinish;
- }
-
- public void setIsLastPage(boolean set) {
- this.dmIsLastPage = set;
- }
-
- public void setCanFinish(boolean set) {
- this.dmCanFinish = set;
- }
-
- public String getBulletText() {
- return this.dmBulletText;
- }
-
- public String getInfoText() {
- return this.dmInfoText;
- }
-
- public boolean isValid() {
- return this.dmWizardPageView == null ? false : this.dmWizardPageView.isValid();
- }
-
- public void show() throws InternalError {
- this.createView();
- }
-
- public void createView() throws InternalError {
- }
-
- public void destroy() {
- this.dmWizardPageView = null;
- this.dmNext = null;
- this.dmPrevious = null;
- this.dmFinal = null;
- }
-
- public void initialize(int direction) throws InternalError, ExternalError {
- if (this.isDirty()) {
- ;
- }
- }
-
- public void validate() throws InternalError, ExternalError {
- }
-
- public void commit() throws InternalError, ExternalError {
- if (this.isDirty()) {
- this.setDirty(false);
- }
- }
-
- public WizardPage getNext() throws InternalError, ExternalError {
- if (this.dmNext == null && (this.dmNext = this.createNext()) != null) {
- this.dmNext.dmPrevious = this;
- }
-
- return this.dmNext;
- }
-
- public WizardPage getPrevious() throws InternalError, ExternalError {
- if (this.dmPrevious == null && (this.dmPrevious = this.createPrevious()) != null) {
- this.dmPrevious.dmNext = this;
- }
-
- return this.dmPrevious;
- }
-
- public WizardPage getFinal() throws InternalError, ExternalError {
- if (this.dmFinal == null) {
- this.dmFinal = this.createFinal();
- }
-
- return this.dmFinal;
- }
-
- public WizardPage createNext() throws InternalError, ExternalError {
- return null;
- }
-
- public WizardPage createPrevious() throws InternalError, ExternalError {
- return null;
- }
-
- public WizardPage createFinal() throws InternalError, ExternalError {
- return null;
- }
-
- public void update(Observable observable, Object object) {
- }
-
- public void firePageModified() {
- ((Observable)this).setChanged();
- ((Observable)this).notifyObservers(new WizardEvent(2));
- }
- }
-